package com.aitou.mrylive.presentation.ui.main.setting;

import android.support.annotation.NonNull;

import com.aitou.mrylive.data.bean.BaseResponse;
import com.aitou.mrylive.data.bean.room.HitList;
import com.aitou.mrylive.domain.HitListManager;
import com.aitou.mrylive.domain.ProfileManager;
import com.aitou.mrylive.presentation.ui.base.BaseObserver;
import com.aitou.mrylive.presentation.ui.base.BasePresenter;
import com.aitou.mrylive.presentation.ui.main.me.profile.ProfileEditInterface;

import java.util.List;

import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * @author Muyangmin
 * @since 1.0.0
 */
public class BlacklistPresenter extends BasePresenter<BlacklistInterface> {

    private HitListManager pm;

    public BlacklistPresenter(BlacklistInterface uiInterface) {
        super(uiInterface);
        pm = new HitListManager();
    }

    public void updateInform(String token){
        Subscription subscription = pm.hitList(token)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseObserver<BaseResponse<List<HitList>>>(getUiInterface()) {
                    @Override
                    public void onSuccess(BaseResponse<List<HitList>> response) {
                        getUiInterface().showResult(response.getData());
                    }
    });
        addSubscription(subscription);
}
}